#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>
#include<unistd.h>
int main()
{
  int fd=open("log.txt",O_WRONLY|O_CREAT|O_APPEND,0666);
  up2(fd,1);

  write(1,"hello \n",0);

  printf("hello fd: %d\n",fd);
  fprintf(stdout,"hello fd:%d\n",fd);
  fputs("helo world\n",stdout);
  const char *message = "hello fwrite\n";
  fwrite(message,1,strlen(message),stdout);




  //int a=12345;
  //char buffer[1024];
 // snprintf(buffer,sizeof(buffer),"%d",a);

//  write(1,buffer,strlen(buffer));


 // int fd1=open("log.txt",O_WRONLY|O_CREAT,0666);
 // printf("fd1:%d\n",fd1);
  return 0;
}
